<template>
	<Root>
		<div class="home">
			<image class="banner" src="/static/images/banner.png"></image>
			<div class="nav-wrapper">
				<div class="suggest-item" @click="toSuggest">
					<image class="icon" src="/static/images/jianyi.png"></image>
					<span>就餐评价</span>
				</div>
				<div class="complain-item" @click="toComplain">
					<image class="icon" src="/static/images/tousu.png"></image>
					<span>意见投诉</span>
				</div>
			</div>
			
			<!-- <div @click="back" class="back-btn">
				<image class="icon" src="/static/images/logout.png"></image>
				<span>选择项目</span>
			</div> -->
		</div>
	</Root>
</template>

<script setup>
import { onMounted, ref, computed } from 'vue';

const projectId = computed(() => uni.getStorageSync('projectId'))	

const toSuggest = () => {
	const token = uni.getStorageSync("token")
	if(!token) {
		uni.redirectTo({
			url: '/pages/wxLogin/wxLogin'
		})
		return
	}
	uni.navigateTo({
		url: '/pages/diningEvaluation/diningEvaluation'
	})
}

const toComplain = () => {
	const token = uni.getStorageSync("token")
	if(!token) {
		uni.redirectTo({
			url: '/pages/wxLogin/wxLogin'
		})
		return
	}
	uni.navigateTo({
		url: '/pages/complain/complain'
	})
}

const back = () => {
	uni.navigateTo({
		url: '/pages/projectList/projectList'
	})
}

</script>

<style lang="scss">
.home{
	background-color: #f5f6fa;
	overflow-y: hidden;
	.banner{
		width: 750rpx;
		height: 300rpx;
	}
	.nav-wrapper{
		padding: 0 32rpx;
		box-sizing: border-box;
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-top: 50rpx;
		.suggest-item,
		.complain-item{
			flex: 1;
			display: flex;
			align-items: center;
			padding: 28rpx 32rpx;
			border-radius: 16rpx;
			color: #fff;
			font-size: 34rpx;
			.icon{
				width: 60rpx;
				height: 60rpx;
				margin-right: 10rpx;
			}
		}
		.suggest-item{
			background-color: #5cc883;
			margin-right: 20rpx;
		}
		.complain-item{
			background-color: #eb7471;
		}
	}
	.back-btn{
		border: 1rpx solid #efefef;
		background-color: #fff;
		display: flex;
		align-items: center;
		margin: 32rpx;
		padding: 20rpx;
		border-radius: 8rpx;
		color: #888;
		.icon{
			width: 50rpx;
			height: 50rpx;
			margin-right: 16rpx;
		}
	}
}
</style>
